package pers.zh.parking.dao;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import pers.zh.parking.po.ParkingSpace;
import pers.zh.parking.po.ParkingSpaceExample;

@Mapper
public interface ParkingSpaceMapper {
    int countByExample(ParkingSpaceExample example);

    int deleteByExample(ParkingSpaceExample example);

    int deleteByPrimaryKey(Integer spaceId);

    int insert(ParkingSpace record);

    int insertSelective(ParkingSpace record);

    List<ParkingSpace> selectByExample(ParkingSpaceExample example);

    ParkingSpace selectByPrimaryKey(Integer spaceId);

    int updateByExampleSelective(@Param("record") ParkingSpace record, @Param("example") ParkingSpaceExample example);

    int updateByExample(@Param("record") ParkingSpace record, @Param("example") ParkingSpaceExample example);

    int updateByPrimaryKeySelective(ParkingSpace record);

    int updateByPrimaryKey(ParkingSpace record);

    int batchGenerate(List<ParkingSpace> list);

    ParkingSpace getRandomFreeSpace(Integer lotId);

    int freeCount(Integer lotId);

    List<ParkingSpace> getSpacesByLotId(int lotId);

    int batchDelete(List<ParkingSpace> list);

    Integer genSpaceId(Integer lotId);

    Integer genSpaceNo(Integer lotId);
}